<script setup>
	import {
		inject
	} from 'vue'
	import {
		provideMsgKey,
		updateLocationKey
	} from '../../constants';

	const message = inject(provideMsgKey, '这是默认值')
	const location = inject('read-only-location', '默认方位')
	const updateLocation = inject(updateLocationKey)
</script>

<template>
	<p>
		Message to grand child: {{ message }}
	</p>
	<p>
		DeepChild input:
		<input v-model="message" />
	</p>
	<p>
		{{location}}
		<button @click="updateLocation">修改文字</button>
		<button @click="location = 'East'">readonly变量在子组件修改不了</button>
	</p>
</template>